﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MonoTouchAutoBind
{
    class DebugOut
    {

        public event EventHandler<GenerateCodeEvent> IgnoreCodePassed;
        private DebugOut()
        { }

        private static DebugOut _instance = new DebugOut();
        public static DebugOut Instance
        {
            get
            {
                return _instance;
            }
        }

        public void Print(string code)
        {
            System.Diagnostics.Debugger.Log(0, "MonotouchBindContainer", code + Environment.NewLine);
            if (IgnoreCodePassed != null)
            {
                IgnoreCodePassed(this, new GenerateCodeEvent(code));
            }
        }
    }

    public class GenerateCodeEvent : EventArgs
    {
        public string GeneratedCode { get; private set; }
        public GenerateCodeEvent(string code)
        {
            this.GeneratedCode = code;
        }
    }
}
